use serde::{Deserialize, Serialize};
use tokio_pg_mapper_derive::PostgresMapper;

#[derive(Deserialize, PostgresMapper, Serialize)]
#[pg_mapper(table = "notices")]
pub struct Notice {
    #[serde(rename = "Content")]
    pub content: String,
    #[serde(rename = "Time")]
    pub time: String,
}

#[derive(Deserialize, PostgresMapper, Serialize)]
#[pg_mapper(table = "users")]
pub struct User {
    pub user_id: i32,
    pub user_name: String,
    pub device_number: String,
    pub ip: String,
}

#[derive(Deserialize, PostgresMapper, Serialize)]
#[pg_mapper(table = "servers")]
pub struct Server {
    #[serde(rename = "ServerID")]
    pub server_id: i32,
    #[serde(rename = "Name")]
    pub name: String,
    #[serde(rename = "Address")]
    pub address: String,
    #[serde(rename = "State")]
    pub state: i16,
    #[serde(rename = "TimeStamp")]
    pub time_stamp: i32,
}
